package org.yunai.swjg.server.module.item.command;

import org.springframework.stereotype.Component;
import org.yunai.swjg.server.core.service.GameMessageCommand;
import org.yunai.swjg.server.core.service.Online;
import org.yunai.swjg.server.module.item.ItemService;
import org.yunai.swjg.server.rpc.message.C_S.C_S_EquipReq;

import javax.annotation.Resource;

/**
 * 穿戴装备命令
 * User: yunai
 * Date: 13-5-6
 * Time: 上午12:37
 */
@Component
public class EquipCommand extends GameMessageCommand<C_S_EquipReq> {

    @Resource
    private ItemService itemService;

    @Override
    public void execute(Online online, C_S_EquipReq msg) {
        itemService.equip(online, msg.getIndex().intValue());
    }
}
